<? 
/***************************************************************************
 *                         dsp_filelist_thumbs.php
 *                        -------------------------
 *   begin                : Friday, Aug 19, 2005
 *   copyright            : (C) 2005 cyber8 netWorks
 *   email                : support@cyber8.net 
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/
 
$view=$_GET["v"];
$thumbnail_cell_size  = $view=="t"?132:100;
$thumbnail_image_size = $view=="t"?80:60;
$thumbnail_padding    = $view=="t"?35:25;
print "<table id=Tx align=left><tr>"; 
/* begin folder list 
 ------------------------------------------------------------------------- */
 
 
reset ($this_folder->pimp_folders);
reset ($this_folder->pimp_files);
 
$cnt=0;
while (list($folder_info_key, $folder) = each($this_folder->pimp_folders))   {   
   
	if ($this_folder->pimp_foldertype==FOLDER_TYPE_REMOTE_ROOT||$this_folder->pimp_foldertype==FOLDER_TYPE_REMOTE_SUBFOLDER)
	    $sub_folder = new pimp_folder ($dirname, $folder["path"], true);  
	else $sub_folder = new pimp_folder ($folder["path"], "", true);
	
	
	$picture_path = "";  
	while (list($file_info_key, $file) = each($sub_folder->pimp_files)) { 
	    if (is_picture ($file["path"])) {
		    $picture_path = $file["path"];
			break;
		}	
	}
	 /* */
	 
    print "<td style='font:8pt tahoma;border:solid 1px ".$border.";background-repeat:no-repeat;background-position :center center' align=center background='".$href."?i=ps'"; 
	$border = $folder_border_colors[$folder["type"]];
	print ">";
	 
	
	print "<div class=deadload title='".$folder["path"]."' style=' 
			 width:".$thumbnail_cell_size.";
			 height:".$thumbnail_cell_size.";			 
			 padding-top:".$thumbnail_padding."'";
			 
	if ($sub_folder->pimp_foldertype==FOLDER_TYPE_REMOTE_SUBFOLDER)
	    print " onclick=\"fb_edit('d','".$dirname."', 'rd', '".$folder["path"]."', 'f','','s','')\"";
	else print " onclick='gofolder(\"".$folder["path"]."\")'";
	print " id='d".$e."'>"; 	
	print "<table cellpadding=0 cellspacing=1><tr>  ";				   
	print "<td>";	 
	if ($picture_path=="") print $folder["caption"];
	else print "<img src='thumbnail.php?w=".$thumbnail_image_size."&i=".$picture_path."'>"; // . $picture_path; 
	print "</td>"; 
	  
    print "</tr></table></div>";
	print $folder["caption"];
	print "</td>" ;
		   
	$cnt++;
	if ($cnt%$preview_width==0&&$view=="t") print "</tr><tr>";
}
 
  
/* begin file list 
 ------------------------------------------------------------------------------ */ 

 
$list="";
$e=0;
while (list($file_info_key, $file) = each($this_folder->pimp_files))   {   
 
 
	if ($file[path]!=$list) {
	    $list=$file[path];
		print "<td style='font:8pt tahoma";
		if ($f==$e) print ";border:solid 2px blue";
		print "' title=\"".$file[name]."\"";
		print " align=center bgcolor=white>";
		print "<div class=offload style='border:solid 1px silver;width:".$thumbnail_cell_size.";height:".$thumbnail_cell_size.";overflow:hidden;color:white' id='d".$e."' onclick='goimage(\"".$e."\")'>";
		if (is_picture($file[path])) print $file[path];
		print "</div> ";
		print filetitle($file[name],20,true); 
		print " </td>"; 
		$cnt++;
		if (($cnt)%$preview_width==0&&$view=="t") print "</tr><tr>";
	}
	$e++;
}
  
print "</td></table>";
 
?>